package demo1;

import java.util.*;

public class Main {

    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();

        while(t-- != 0){
            int h = in.nextInt(), a = in.nextInt();
            int H = in.nextInt(), A = in.nextInt();

            if(a >= H){
                System.out.println(-1);
            }else{
                int m = H / a + (H % a != 0 ? 1 : 0);  //怪物能抗几下
                int n = m - 1;  //杀死一只怪物，玩家被攻击几下
                int x = n * A;  //杀死一只怪物，玩家掉的血量
                int ret = h / x - (h % x == 0 ? 1 : 0);
                System.out.println(ret);
            }
        }
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        Set<String> set = new HashSet<>();

        for(int i = 0; i < n; i++){
            char[] tmp = in.next().toCharArray();
            Arrays.sort(tmp);
            set.add(new String(tmp));
        }
        System.out.println(set.size());
    }


}
